from graphviz import Digraph

# 创建Graphviz Digraph对象
dot = Digraph()

# 添加节点
dot.node('input', label='Input: 3D Color Retinal Image')
dot.node('segmentation', label='U-Net\nImage Segmentation\n(Arterioles, Veins, Hard Exudates, Hemorrhages, Optic Disc, Fovea)')
dot.node('fusion', label='Feature Fusion\n(Arterioles, Veins, Hard Exudates, Hemorrhages, Optic Disc, Fovea)')
dot.node('description', label='Description of Fusion Process\n(CNN Features)')

# 添加边
dot.edge('input', 'segmentation', label='Segmentation Features')
dot.edge('segmentation', 'fusion', label='Fused Features')
dot.edge('fusion', 'description', label='CNN Characteristics')

# 保存模型图
dot.render('detailed_feature_fusion_process', format='png', cleanup=True)

# 显示模型图
dot